{% extends "dpress/ext_base.html" %}

{% load i18n %}
{% load el_pagination_tags %}
{% load dpress_tags %}
{% load lbutils %}

<div class="contents">
{% block contents %}
    {% if tag %}
        <h2>{% trans "Posts Tagged" %}: {{tag}}</h2>
    {% endif %}

    {% if archive_month %}
        <h2>{% trans "Archives" %}: {{ archive_month|date:"F Y" }}</h2>
    {% endif %}

    {% paginate posts %}
    {% for o in posts %}
    <div class="entry">
        <h3><a href="{{o.get_absolute_url}}">{{o}}</a></h3>
        <p class="meta">{% trans "written by" %} {{o.author}}, {% trans "on" %} {{o.publish|date:"Y-m-d H:i"}}</p>
        <div class="text">
            <div class="document">
            {{ o.body|md }}
            </div>
        </div>
        <p class="related">
            {% trans "Tagged as" %}:
            {% for o in o.tags.all %}
              <a href="{% url 'dpress_tag' o.name %}"> 
                {{ o }} 
              </a>
            {% endfor %}
            |
            <a href="{{o.get_absolute_url}}#disqus_thread">Link</a>
        </p>
    </div>
    {% endfor %}
    
  {% show_pages %}
{% endblock %}
</div>

{% block footer_js %}
  {% get_setting "DISQUS_SHORTNAME" "" "DISQUS_SHORTNAME" %}
  {% if DISQUS_SHORTNAME %}
  <script type="text/javascript">
    var disqus_shortname = "{{DISQUS_SHORTNAME}}";

    (function () {
        var s = document.createElement('script'); s.async = true;
        s.type = 'text/javascript';
        s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
    }());
  </script>
  {% endif %}
{% endblock %}
